﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using model;
using Bll;

public partial class Applictioncfg : System.Web.UI.Page
{
    ApplicationBll bll = new ApplicationBll();
    protected void Page_Load(object sender, EventArgs e)
    {
        BindGridView();
    }
    void BindGridView()
    {
        string keyword = TextBox1.Text.Trim();
        GridView1.DataSource = bll.getApplications(keyword, 1);
        this.GridView1.DataBind();
    }
    protected void btnInsert_Click(object sender, EventArgs e)
    {
        Response.Redirect("inserta.aspx");
    }
    protected void lbtndelete_Click(object sender, EventArgs e)
    {
        string ano = ((LinkButton)sender).CommandArgument;
        Response.Redirect("deletea.aspx?ano=" + ano);
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        BindGridView();
    }
    protected void lbtn1_Click(object sender, EventArgs e)
    {
        BindGridView();
    }
}